class JSZipExample {
	public constructor() {
	}

	public test(): void {
		let gameList = RES.getGroupByName("game");
        let zipName = "jszipgame_zip"
		RES.getResAsync(zipName, (data) => {
			this.parseCfg(gameList, zipName);
		}, this)
	}

	private parseCfg(groupList: Array<any>, zipName: string): void
    {
        let idx = 0;
        let data = RES.getRes(zipName);
        JSZip.loadAsync(data).then((zip) =>
        {
            let funcs = [];
            for (let i = 0; i < groupList.length; i++)
            {
                let groupObj = groupList[i];
                let url = groupObj.url;
                let key = String(groupObj.name).toLocaleLowerCase();
                let baseName = RES.path.basename(url);
                let file = zip.file(baseName);
                if (file)
                {
                    file.async('text').then((data) =>
                    {
                        console.log(data);
                    })
                }
            }
        })
    }

	private static instance: JSZipExample;
    public static getIt(): JSZipExample
    {
        if (!this.instance)
            this.instance = new JSZipExample();

        return this.instance;
    }
}